<template>
    <div id="tmp1">
        <div class="mui-content" style="background-color:#fff">
            <ul class="mui-table-view mui-grid-view">
                <li v-for="item in list" class="mui-table-view-cell mui-media mui-col-xs-6">
                    <a href="#">
                        <img class="mui-media-object" :src="item.img_url">
                        <div class="mui-media-body" v-text="item.title"></div>
                        <div class="desc">
                            <p>
                                <span>￥{{item.sell_price}}</span>
                                <s>￥{{item.market_price}}</s>
                            </p>
                            <p>
                            <span class="left">热卖中</span>
                            <span class="right">剩余{{item.stock_quantity}}件</span>
                            </p>
                        </div>
                    </a>
                </li>
                <li class="mui-table-view-cell mui-media mui-col-xs-6">
                    <a href="#">
                        <img class="mui-media-object" src="http://182.254.146.100:8080/upload/201504/18/thumb_201504181258575445.jpg">
                        <div class="mui-media-body">想要一间这样的木屋，静静的喝咖啡</div>
                        <div class="desc">
                            <p>
                                <span>￥5555</span>
                                <s>￥5555</s>
                            </p>
                            <p>
                                <span class="left">热卖中</span>
                                <span class="right">剩余6666件</span>
                            </p>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</template>
<script>
    import common from '../../kits/common.js';
    import { Toast } from 'mint-ui';
    export default{
        data(){
            return {
                list:[]
            }
        },
        created(){
            this.getlist();
        },
        methods:{
            getlist(){
                var url=common.apidomain+'/api/getgoods?pageindex=1';
                this.$http.get(url).then(function(res){
                    if(res.body.status!=0){
                        Toast(res.body.status);
                        return;
                    }
                    this.list=res.body.message;
                })
            }
        }

    }
</script>
<style scoped>
    #mui-content li{
        border: 1px solid rgba(0,0,0,0.4);
        -webkit-box-shadow: 0 0 4px #000;
        -moz-box-shadow: 0 0 4px #000 ;
        box-shadow: 0 0 4px #000 ;
        margin-left: 4px;
        padding: 5px;
    }

    #mui-content .mui-media-body{
        color: #0094ff;
    }

    #mui-content .desc{
        height: 60px;
        background-color: rgba(0,0,0,0.1);
        margin-top: 10px;
        padding: 5px;
        text-align: left;
    }
    #mui-content .desc span{
        color: red;
        margin-right: 15px;
    }
    #mui-content a{
        padding-left: 0px;
        margin-left: 0px;
    }

    #mui-content .desc .right{
        position: absolute;
        right: 10px;
        bottom: 0px;
    }

    #mui-content .desc .left{
        position: absolute;
        left: 10px;
        bottom: 0px;
    }
</style>